package com.farmcode.plugin.objectinfo.datasource;


import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Set;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author oscar
 */
public class FARMCodeResulset extends BaseFARMCodeResultSet {

    private int index = -1;
    
    public List<HashMap<String, String>> resultset;
    
    public FARMCodeResulset(){
        resultset = new ArrayList<HashMap<String, String>>();
    }

    @Override
    public boolean next() throws SQLException {
        index++;
        if(resultset != null && resultset.isEmpty()){
            return false;
        }
        return  resultset.size() > index;
    }
    
    
    
    @Override
    public String getString(String string) throws SQLException {
        return resultset.get(index).get(string.toUpperCase());
    }  
    
}
